#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "VariableAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// WriteVariableAction
/// WriteVariableAction is an abstract class for VariableActions that change
/// Variable values.
/// </summary>
class UMLMODEL_EXPORT WriteVariableAction : public VariableAction {

public: // Constructors and destructors
    explicit WriteVariableAction(const QString& umlType="uml::WriteVariableAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// value getter
    /// The InputPin that gives the value to be added or removed from the Variable.
    /// </summary>
    shared_ptr<InputPin> value() const;

    /// <summary>
    /// value setter
    /// The InputPin that gives the value to be added or removed from the Variable.
    /// </summary>
    void setValue(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// value
    /// The InputPin that gives the value to be added or removed from the Variable.
    /// </summary>
    shared_ptr<InputPin> value_;

};

} // namespace uml
